package work.parabola.keyboardswitch.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class PlateConst {

    @Getter
    @AllArgsConstructor
    public enum PlateTypeEnum {
        TESTER(0, 0,"试轴器"),
        LAYOUT104(104, 104, "104键盘配列"),
        LAYOUT108(108, 108, "108键盘配列"),
        LAYOUT96(96, 100, "96键盘配列"),
        LAYOUT980(980, 98, "980配列"),
        LAYOUT87(87, 87, "87配列"),
        LAYOUT84(84, 84, "84配列"),
        LAYOUT64(64, 64, "左移64配列"),
        LAYOUT63(63, 63, "63配列（非左移64配列）"),
        LAYOUT68(68, 68, "68配列"),
        LAYOUT61(61, 61, "61配列");
        private int code;

        private int number;

        private String desc;

        public static PlateTypeEnum codeOf(int code) {
            for (PlateTypeEnum plateTypeEnum : values()) {
                if (plateTypeEnum.getCode() == code) {
                    return plateTypeEnum;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum PlateOpenEnum {
        NONOPEN(0, "私有"),
        OPEN(1, "公开");
        private int code;
        private String desc;

        public static PlateOpenEnum codeOf(int code) {
            for (PlateOpenEnum plateOpenEnum : values()) {
                if (plateOpenEnum.getCode() == code) {
                    return plateOpenEnum;
                }
            }
            return null;
        }
    }
}
